import Vue from 'vue'
import Router from 'vue-router'
import WeChat from './views/WeChat'
import RoomList from './views/RoomList'
import Room from './views/Room'
import LoginPage from './views/LoginPage'
import ReginPage from './views/ReginPage'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect:'/login_page',
      hidden:true,
      description:'主页'
    },
    {
      path: '/login_page',
      component:LoginPage,
      hidden:true,
      description: '登录'
    },
    {
      path: '/regin_page',
      component:ReginPage,
      hidden:true,
      description: '注册'

    } ,
    {
      path: '/wechat',
      redirect:'/wechat/roomlist',
      component:WeChat,
      hidden:false,
      description:'聊天',
      children:[
        {
          path: 'roomlist',
          name:'roomlist',
          component: RoomList,
          hidden:false,
          description:'聊天室列表',
        },
        {
          path: 'room/:id',
          component: Room,
          hidden:false,
          description:'某一聊天室',
        },
      ]
    }
  ]
})
